
const getDefaultState = () => {
  return {
    pay_data: {}
  }
}

const state = getDefaultState()

const mutations = {
  RESET_STATE: (state) => {
    Object.assign(state, getDefaultState())
  },
  SET_PAY_DATA: (state) =>{

  },
  GET_PAY_DATA: (state) =>{

  },
  REMOVE_PAY_DATA: (state) =>{

  },
}

const actions = {
  setPayData({commit}, data){
    state.pay_data = data;
  },
  getPayData({commit}, data){

  },
  removePayData({commit}, data){

  },
  // user login
  login({commit}, userInfo) {
    const {username, password} = userInfo
    return new Promise((resolve, reject) => {
      commit('SET_USER_INFO', {})
      resolve()
    })
  },
  // user logout
  logout({commit, state}) {
    return new Promise((resolve, reject) => {
      commit('RESET_STATE')
      resolve()
    })
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

